package com.cq.hd.common.enums.biz;

import lombok.Getter;

/**
 * @description: 短信验证码类型枚举  1-商户手机号登录，2-商家后台手机号登录, 3-修改商户登录密码, 4-修改商家后台登录密码，5-修改经纪人银行卡 6-修改用户/商家密码
 * @author: mYunYu
 * @date: 2021/8/20 11:08
 * @version: v1.0
 */
public enum SmsTypeEnum {

    SMS_MERCHANT_LOGIN(1, "merchant-login"),
    SMS_ADMIN_BUSINESS_LOGIN(2, "admin-business-login"),
    SMS_UPDATE_MERCHANT_LOGIN_PWD(3, "update-merchant-login-pwd"),
    SMS_UPDATE_BUSINESS_ADMIN_LOGIN_PWD(4, "update-business-admin-login-pwd"),
    SMS_UPDATE_AGENT_BANK_INFO(5, "update-agent-bank-info"),
    SMS_UPDATE_APP_USER_LOGIN_PWD(6, "update-app-user-login-pwd"),
    SMS_UPDATE_MERCHANT_BANK_CARD(7, "update-merchant-bank-card")
    ;

    @Getter
    private final Integer value;

    @Getter
    private final String name;

    SmsTypeEnum(Integer value, String name) {
        this.value = value;
        this.name = name;
    }

    public static SmsTypeEnum typeOf(Integer value) {
        SmsTypeEnum[] values = SmsTypeEnum.values();
        for (SmsTypeEnum v : values) {
            if (v.value.equals(value)) {
                return v;
            }
        }
        return null;
    }

    public static SmsTypeEnum typeOf(String name) {
        SmsTypeEnum[] values = SmsTypeEnum.values();
        for (SmsTypeEnum v : values) {
            if (v.name.equals(name)) {
                return v;
            }
        }
        return null;
    }


}
